package com.cbh.feign.controller.user;



import java.io.IOException;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;

import com.cbh.api.model.ApiResult;

import net.sf.json.JSONObject;

public interface FileControllerBase {

	/**
	 * 上传文件接口
	 * 
	 * @param file
	 * 
	 * @return
	 */
	@RequestMapping(value = "/exte/file/upload", method = RequestMethod.POST)
	@ResponseBody
	public ApiResult<JSONObject> upload(@RequestParam(value = "file", required = true) MultipartFile file);

	/**
	 * 上传文件接口
	 * 
	 * @param file
	 * 
	 * @return
	 */
	@RequestMapping(value = "/exte/base64File/upload", method = RequestMethod.POST)
	@ResponseBody
	public ApiResult<JSONObject> upload(@RequestBody(required = true) String file);

	@RequestMapping(value = "/exte/base64File/OcrFile", method = RequestMethod.POST)
	@ResponseBody
	public ApiResult<JSONObject> OcrFile(@RequestParam(value = "file", required = true) MultipartFile tmpFile,
			@RequestParam(value = "type", required = true) String type);

	/**
	 * 上
	 * 
	 * @param file
	 * 
	 * @return
	 * @throws IOException
	 */
	@RequestMapping(value = "/exte/base64File/Ocr", method = RequestMethod.POST)
	@ResponseBody
	public ApiResult<JSONObject> Ocr(@RequestBody(required = true) String file,
			@RequestParam(value = "type", required = true) String type);

}
